<template>
  <section class="post_detail_table">
    <div class="post_detail_table__header">
      <span>岗位人员名单</span>
      <el-button style="float: right" size="mini" type="primary" @click="handleExport">批量导出</el-button>
    </div>
    <el-table stripe align="center" :data="tableData"  row-key="id" style="width: 100%">
       <el-table-column
      type="selection"
      width="55"
       @selection-change="handleSelectionChange"
       >
    </el-table-column>
      <el-table-column label="岗位名称"></el-table-column>
      <el-table-column label="岗位代码"></el-table-column>
      <el-table-column label="岗位状态"></el-table-column>
      <el-table-column label="岗位成员"></el-table-column>
      <el-table-column label="账户"></el-table-column>
      <el-table-column width="210" label="操作">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" @click="handleDetail(scope.$index, scope.row)">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="post_detail_table__pagination">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="prev, pager, next, sizes, jumper"
        :total="400"
      ></el-pagination>
    </div>
  </section>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "postDetailTable",
  data() {
    return {
      currentPage: 1,
       multipleSelection: []
    };
  },
  computed: {
    ...mapGetters({
      tableData: "postDetail/tableData"
    })
  },
  methods: {
    handleSizeChange(val) {
      // eslint-disable-next-line no-console
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      // eslint-disable-next-line no-console
      console.log(`当前页: ${val}`);
    },
    handleDetail() {

    },
    handleExport() {},
    handleSelectionChange(val) {
        this.multipleSelection = val;
      }
  }
};
</script>
<style scoped>
.post_detail_table {
  margin: 16px 0;
}
.post_detail_table__pagination {
  margin: 16px 0;
  text-align: right;
}
.post_detail_table__header {
  margin-bottom: 16px;
  line-height: 30px;
}
</style>
